hvm: local_events_need_delivery() must take into account VLAPIC/PIC status.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 21 Feb 2007 19:12:16 +0000 (19:12 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 21 Feb 2007 19:12:16 +0000 (19:12 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/include/asm-x86/event.h

index 475339550b0c0091f585e8cce6da052ae97a7a11..86f6653f834203adad3f538b2929e6c15575f05c 100644 (file)
@@ -10,6 +10,7 @@
 #define __ASM_EVENT_H__
 
 #include <xen/shared.h>
+#include <asm/hvm/irq.h> /* cpu_has_pending_irq() */
 
 static inline void vcpu_kick(struct vcpu *v)
 {
@@ -37,9 +38,9 @@ static inline void vcpu_mark_events_pending(struct vcpu *v)
 static inline int local_events_need_delivery(void)
 {
     struct vcpu *v = current;
-    /* Note: Bitwise operations result in fast code with no branches. */
-    return (!!vcpu_info(v, evtchn_upcall_pending) &
-             !vcpu_info(v, evtchn_upcall_mask));
+    return ((vcpu_info(v, evtchn_upcall_pending) &&
+             !vcpu_info(v, evtchn_upcall_mask)) ||
+            (is_hvm_vcpu(v) && cpu_has_pending_irq(v)));
 }
 
 static inline int local_event_delivery_is_enabled(void)